class Rectangle:
    def __init__(self, width, height):
        self._width = width
        self._height = height

    @property
    def width(self):
        return self._width

    @width.setter
    def width(self, value):
        if value <= 0:
            print("错误提示：宽度必须为正值。")
        else:
            self._width = value

    @property
    def height(self):
        return self._height

    @height.setter
    def height(self, value):
        if value <= 0:
            print("错误提示：高度必须为正值。")
        else:
            self._height = value

    @property
    def area(self):
        return self._width * self._height

# 测试代码
a = Rectangle(3, 4)
a.width = -5  # 输出错误提示
a.width = 5
a.height = 0  # 输出错误提示
a.height = 2
print(a.area)   # 返回10
# a.area = 12  # 输出AttributeError: can't set attribute